<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display" %>

<s:if test="id == null">
    <s:set var="actionVariant">create</s:set>
    <s:set var="actionName">purchasers/save</s:set>
    <s:set var="titleKey">purchasersaction.title.create</s:set>
</s:if>
<s:else>
    <s:set var="actionVariant">update</s:set>
    <s:set var="actionName">purchasers/update</s:set>
    <s:set var="titleKey">purchasersaction.title.update</s:set>
</s:else>

<html>

  <head>
    <title><s:text name="purchasersaction.title"/></title>
  </head>

  <body>

    <p class="wwPageTitle">
      <img src="<s:url value='/images/purchaser.gif'/>"/>
      <s:text name="%{#titleKey}"/>
    </p>

    <s:actionerror />
    <s:actionmessage/>
    <s:fielderror />

    <s:form action="%{#actionName}"
            method="POST"
            cssClass="wwFilterTable">

      <s:hidden name="id" />

      <tr>
        <th colspan="2">
          <s:text name="%{#titleKey}"/>
        </th>
      </tr>

      <s:label key="purchasersaction.id"
               name="model.id"
               value="%{model.id}" />
               
      <s:textarea key="purchasersaction.name"
                  name="model.name"
                  required="true"
                  cols="75"
                  rows="2" />
               
      <s:textarea key="purchasersaction.address"
                   name="model.address"
                   required="true"
                   cols="75"
                   rows="2" />

      <s:textfield key="purchasersaction.nip"
                   name="model.nip"
                   size="15"
                   maxlength="13" />
                   
      <tr>
        <td colspan="2" class="wwFilterTableButtonBar">
          <s:submit key="button.submit" cssClass="inputButton" theme="simple"/>
          <s:submit key="button.cancel" cssClass="inputButton" theme="simple" action="purchasers/list" />
        </td>
      </tr>
      
    </s:form>

  </body>

</html>
